import studentModel from "../../src/sequlize/manyToMany/student/studentModel.js";
import hobbyModel from "../../src/sequlize/manyToMany/hobby/hobbyModel.js";
import student_hobbyModel from "../../src/sequlize/manyToMany/student_hobby.js";
//foreignKey用于指定关联的外键字段 sequelize默认是studentId和hobbyId
studentModel.belongsToMany(hobbyModel, {through: student_hobbyModel, foreignKey: 'studentId'});
hobbyModel.belongsToMany(studentModel, {through: student_hobbyModel, foreignKey: 'hobbyId'});